package com.imooc.security;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionSignUp;
import org.springframework.stereotype.Component;


//@Component
public class DemoConnectionSignUp implements ConnectionSignUp {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    public String execute(Connection<?> connection) {
        // 根据社交用户信息默认创建用户并返回用户唯一标识
        String providerUserId = connection.getKey().getProviderUserId();
        logger.debug("DemoConnectionSignUp.execute :::"+providerUserId);
        return providerUserId;
    }
}
